package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BizCmsArticle;
import com.nmf.dao.gen.bean.BizCmsArticleExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizCmsArticleMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @SelectProvider(type=BizCmsArticleSqlProvider.class, method="countByExample")
    long countByExample(BizCmsArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @DeleteProvider(type=BizCmsArticleSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizCmsArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @Delete({
        "delete from cms_article",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @Insert({
        "insert into cms_article (id, category_id, ",
        "title, link, color, ",
        "image, keywords, ",
        "description, weight, ",
        "weight_date, hits, ",
        "posid, custom_content_view, ",
        "view_config, create_by, ",
        "create_date, update_by, ",
        "update_date, remarks, ",
        "del_flag)",
        "values (#{id,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR}, ",
        "#{title,jdbcType=VARCHAR}, #{link,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, ",
        "#{image,jdbcType=VARCHAR}, #{keywords,jdbcType=VARCHAR}, ",
        "#{description,jdbcType=VARCHAR}, #{weight,jdbcType=INTEGER}, ",
        "#{weightDate,jdbcType=TIMESTAMP}, #{hits,jdbcType=INTEGER}, ",
        "#{posid,jdbcType=VARCHAR}, #{customContentView,jdbcType=VARCHAR}, ",
        "#{viewConfig,jdbcType=LONGVARCHAR}, #{createBy,jdbcType=VARCHAR}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, ",
        "#{updateDate,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, ",
        "#{delFlag,jdbcType=CHAR})"
    })
    int insert(BizCmsArticle record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @InsertProvider(type=BizCmsArticleSqlProvider.class, method="insertSelective")
    int insertSelective(BizCmsArticle record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @SelectProvider(type=BizCmsArticleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="category_id", property="categoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="link", property="link", jdbcType=JdbcType.VARCHAR),
        @Result(column="color", property="color", jdbcType=JdbcType.VARCHAR),
        @Result(column="image", property="image", jdbcType=JdbcType.VARCHAR),
        @Result(column="keywords", property="keywords", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="weight", property="weight", jdbcType=JdbcType.INTEGER),
        @Result(column="weight_date", property="weightDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="hits", property="hits", jdbcType=JdbcType.INTEGER),
        @Result(column="posid", property="posid", jdbcType=JdbcType.VARCHAR),
        @Result(column="custom_content_view", property="customContentView", jdbcType=JdbcType.VARCHAR),
        @Result(column="view_config", property="viewConfig", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<BizCmsArticle> selectByExample(BizCmsArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @Select({
        "select",
        "id, category_id, title, link, color, image, keywords, description, weight, weight_date, ",
        "hits, posid, custom_content_view, view_config, create_by, create_date, update_by, ",
        "update_date, remarks, del_flag",
        "from cms_article",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="category_id", property="categoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="link", property="link", jdbcType=JdbcType.VARCHAR),
        @Result(column="color", property="color", jdbcType=JdbcType.VARCHAR),
        @Result(column="image", property="image", jdbcType=JdbcType.VARCHAR),
        @Result(column="keywords", property="keywords", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="weight", property="weight", jdbcType=JdbcType.INTEGER),
        @Result(column="weight_date", property="weightDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="hits", property="hits", jdbcType=JdbcType.INTEGER),
        @Result(column="posid", property="posid", jdbcType=JdbcType.VARCHAR),
        @Result(column="custom_content_view", property="customContentView", jdbcType=JdbcType.VARCHAR),
        @Result(column="view_config", property="viewConfig", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    BizCmsArticle selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @UpdateProvider(type=BizCmsArticleSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizCmsArticle record, @Param("example") BizCmsArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @UpdateProvider(type=BizCmsArticleSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizCmsArticle record, @Param("example") BizCmsArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @UpdateProvider(type=BizCmsArticleSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizCmsArticle record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cms_article
     */
    @Update({
        "update cms_article",
        "set category_id = #{categoryId,jdbcType=VARCHAR},",
          "title = #{title,jdbcType=VARCHAR},",
          "link = #{link,jdbcType=VARCHAR},",
          "color = #{color,jdbcType=VARCHAR},",
          "image = #{image,jdbcType=VARCHAR},",
          "keywords = #{keywords,jdbcType=VARCHAR},",
          "description = #{description,jdbcType=VARCHAR},",
          "weight = #{weight,jdbcType=INTEGER},",
          "weight_date = #{weightDate,jdbcType=TIMESTAMP},",
          "hits = #{hits,jdbcType=INTEGER},",
          "posid = #{posid,jdbcType=VARCHAR},",
          "custom_content_view = #{customContentView,jdbcType=VARCHAR},",
          "view_config = #{viewConfig,jdbcType=LONGVARCHAR},",
          "create_by = #{createBy,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=VARCHAR},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizCmsArticle record);
}